from django.db import models

# Create your models here.
class UserInfo(models.Model):
    username = models.CharField(max_length=32)
    password = models.CharField(max_length=32)
    
class HumitureInfo(models.Model):
    sn = models.IntegerField(primary_key=True)
    alias = models.CharField(max_length=20)
    date_time = models.DateTimeField(auto_now=True,max_length=20)
    tem = models.IntegerField(null=True)
    hum = models.IntegerField(null=True)
    
class wifi_elec(models.Model):
    wifi = models.CharField(max_length=20)
    elec = models.CharField(max_length=20)
    
class message(models.Model):
    value = models.CharField(max_length=100)
    data = models.CharField(max_length=35)
    
class info(models.Model):
    time=models.DateTimeField(max_length=30)
    tem_value=models.CharField(max_length=20)
    hum_value=models.CharField(max_length=20)
    
class version(models.Model):
    sn = models.IntegerField(primary_key=True)
    alias = models.CharField(max_length=20)
    now_version = models.CharField(max_length=20)
    new_version = models.CharField(max_length=20)
    need_update = models.IntegerField()
    
class deviceInfo(models.Model):
    sn = models.IntegerField(primary_key=True)
    alias = models.CharField(max_length=20)
    now_version = models.CharField(max_length=20)